//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//

package com.andromeda.androbench2;

import android.content.Context;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.RandomAccessFile;
import java.util.UUID;

public class Installation {
    private static final String INSTALLATION = ".INSTALLATION";
    private static String deviceID = null;

    public Installation() {
    }

    public static String getId(Context var0) {
        synchronized(Installation.class){}

        String var4;
        try {
            if (deviceID == null) {
                File var2 = new File(var0.getFilesDir(), ".INSTALLATION");

                try {
                    if (!var2.exists()) {
                        writeInstallationFile(var2);
                    }

                    deviceID = readInstallationFile(var2);
                } catch (Exception var7) {
                    throw new RuntimeException(var7);
                }
            }

            var4 = deviceID;
        } finally {
            ;
        }

        return var4;
    }

    private static String readInstallationFile(File var0) throws IOException {
        RandomAccessFile var1 = new RandomAccessFile(var0, "r");
        byte[] var2 = new byte[(int)var1.length()];
        var1.readFully(var2);
        var1.close();
        return new String(var2);
    }

    private static void writeInstallationFile(File var0) throws IOException {
        FileOutputStream var1 = new FileOutputStream(var0);
        var1.write(UUID.randomUUID().toString().getBytes());
        var1.close();
    }
}
